#pragma once
#include <iostream>
#include <list>
#include "D:\C_learning\CPP\MyList\MyList.h"
#include "D:\C_learning\CPP\MyList\MyIterator.h"

namespace my {
	template <class T>
	class queue {
	private:
		std::list<T> _container;
	public:
		//constructor
		queue() {}

		queue(const T& data) 
			:_container(1, data)
		{
		}

		bool empty() const {
			return _container.empty();
		}

		size_t size() const {
			return _container.size();
		}

		T& front() {
			return _container.front();
		}

		const T& front() const {
			return _container.front();
		}

		T& back() {
			return _container.back();
		}

		const T& back() const {
			return _container.back();
		}

		void push(const T& val) {
			_container.push_back(val);
		}

		void pop() {
			_container.pop_front();
		}

		void swap(queue& x) {
			_container.swap(x._container);
		}
	};
}